package io.xiyou.account2.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.xiyou.account2.dao.model.LocalCancelLog;
import org.apache.ibatis.annotations.Insert;
import org.springframework.stereotype.Repository;

@Repository
public interface LocalCancelLogMapper extends BaseMapper<LocalCancelLog> {

    /**
     * 查询分支事务cancel是否已执行
     *
     * @param localTradeNo 本地事务编号
     * @return
     */
    int isExistCancel(String localTradeNo);

    @Insert("insert into local_cancel_log values(#{txNo},now());")
    int addCancel(String localTradeNo);

}